package cn.xd.common.enums.auth;

import cn.xd.common.enums.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum AppUserTypeEnum implements IBaseEnum<Integer> {
    MAIN_ADMIN(AppTypeEnum.MAIN.getCode() * 100 + UserTypeEnum.ADMIN.getCode(), "核心系统管理者"),
    MAIN_CUSTOMER(AppTypeEnum.MAIN.getCode() * 100 + UserTypeEnum.CUSTOMER.getCode(), "核心系统使用者");

    public AppTypeEnum getAppTypeEnum() {
        return IBaseEnum.getEnumByCode(this.getCode() / 100, AppTypeEnum.class);
    }

    public UserTypeEnum getUserTypeEnum() {
        return IBaseEnum.getEnumByCode(this.getCode() % 100, UserTypeEnum.class);
    }

    private final Integer code;
    private final String info;

}
